<?php $this->load->view(TEMPLATE_NAME.'/front/header'); ?>

<style>
label.error {
    margin: 0;
}
</style>
<script type="text/javascript" src="<?php echo base_url()?>js/jquery.validate.pack.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	var result_email = true;
	$.validator.addMethod("emailCheck", function(val, elem) {
        $.post("<?php echo site_url('json_request/check_directory_email')?>" ,{
             email: $('#email').val()
        },function(data){
            result_email = (data=="TRUE") ? true : false;
        }, "json");
        return result_email;
    });

    $("#signup_form").validate({
    	onkeyup: false,
        rules: {
            email: {
                required : true,
                email : true,
                emailCheck: true
            },
            re_email: {
                equalTo: "#email"
            },
            password: {
                required : true,
                minlength: 6
            },
            re_password: {
                equalTo: "#password"
            }

        },
        messages: {
            email: {
                required : "Please input your e-mail address",
                email : "Please input a valid e-mail address",
                emailCheck : "The e-mail address already exists in the database"
            },
            re_email: {
                equalTo: "E-mail address does not match"
            },
            password: {
                required : "Please input your password",
                minlength: "Please input a password of more than 6 characters"
            },
            re_password: {
                equalTo: "Password does not match"
            }
        }
      });
});
</script>
<div id="container_wrapper">

    	<div class="left_part">
<?php $this->load->view(TEMPLATE_NAME.'/front/register/side_left'); ?>
</div>
<div class="page">

<p class="f15 purple" style="font-weight:bold;">All Agencies welcome to sign up and advertise</p>

<hr />
<?php
$attributes = array('id' => 'signup_form');
echo form_open('register/login_information',$attributes);
?>
<div class="dir dir_add_signup">
<div class="clear"></div>
E-mail: <span class="required">(required)</span><br /> 
<?php 
$data_email = array(
    'id' => 'email',
    'name' => 'email',
	'value' => ($this->session->userdata('email')? $this->session->userdata('email'):$form_email),
);
echo form_input($data_email); ?>
<!--<br/>-->
<br/><?php echo form_error('email'); ?>
Confirm E-mail: <span class="required">(required)</span><br />
<?php echo form_input('re_email',$form_re_email); ?>
<br/>
<?php echo form_error('re_email','<label class="error">','</label>'); ?><br/>
Password: <span class="required">(required)</span><br />
<?php 
$data_password = array(
    'id' => 'password',
    'name' => 'password'
);
echo form_password($data_password); ?>
<br/>
<?php echo form_error('password','<label class="error">','</label>'); ?><br/>
Confirm p/word: <span class="required">(required)</span><br /> 
<?php echo form_password('re_password'); ?>
<br/>
<?php echo form_error('re_password','<label class="error">','</label>'); ?><br/>
<div class="clear"></div>
<?php /*?>
<label style="float:left;">Security: <span class="required">(required)</span></label>
 
<div style="float:right;"><?php if(!empty($recaptcha)){ ?>
<?php echo $recaptcha; ?>
<?php echo form_error('recaptcha_response_field','<label class="error">','</label>');
}?>
</div><?php */?>
<div class="clear"></div>
<hr />
<div class="">

<?php
$form_button = array(
  'type'=>'submit',
  'name'=>'submit',
  'value'=>'submit',
  'content'=>'Submit'
);
echo form_button($form_button) ?>

</div>
<hr />
</div><!-- dir -->
<?php echo form_close(); ?>

</div>
    <?php $this->load->view(TEMPLATE_NAME.'/front/side_right'); ?>
</div>

<?php $this->load->view(TEMPLATE_NAME.'/front/footer'); ?>

